home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / Simple Help / SimpleHelpTypes.h < prev    next >
Text File  |  1994-07-13  |  4KB  |  121 lines

  1. /****************************************************************************************
  2. *
  3. *
  4. *        SimpleHelpTypes.h        -type declarations for simplehelp system
  5. *
  6. *        ©1994, Graham Cox. All Rights Reserved.
  7. *
  8. *        9/2/94
  9. *
  10. ****************************************************************************************/
  11.  
  12.  
  13. #include    "ScrollDialog.h"
  14.  
  15.  
  16. typedef struct
  17. {
  18.     WindowPtr    ownerWindow;        // window we are displayed in
  19.     ListHandle    topicList;            // list of topics
  20.     short        topicID;            // resource ID of topic list
  21.     short        indentPixels;        // number of pixels per indent value
  22.     short        listItemID;            // ID number of the list item
  23.     short        textItemID;            // ID number of the text item
  24.     Cell        lastSelection;        // remember which one we last displayed
  25.     short        missingPageID;        // ID of string to show missing page error
  26.     short        fontID;                // font to use
  27.     short        fontSize;            // size of the font
  28.     short        hyperTextIndex;        // index of hypertext style in style run table
  29.     short        hyperTextStyle;        // style of hypertext link
  30.     short        curPageResID;        // resource ID of the current page
  31.     short        helpResFileRef;        // refnum of res file, where used
  32.     short        swapResFileRef;        // refnum of current res file, where used and different
  33.     long        reserved;
  34. }
  35. SimHelpRecord, *SimHelpPtr, **SimHelpHdl;
  36.  
  37.  
  38. #define        defaultFont            geneva
  39. #define        defaultFontSize        9
  40. #define        defaultIndent        10
  41. #define        defaultTextResID    128
  42. #define        helpNextButton        2
  43. #define        helpPrevButton        3
  44. #define        pageMissingStrID    128
  45.  
  46. typedef struct
  47. {
  48.     short        indent;
  49.     short        tStyle;
  50.     short        tFont;
  51.     short        pageID;
  52.     char        topicString;
  53. }
  54. topicRec, *topicRecPtr;
  55.  
  56.     
  57. typedef struct
  58. {
  59.     short        indent;
  60.     short        tStyle;
  61.     short        tFont;
  62.     short        pageID;
  63.     Str255        topicString;
  64. }
  65. bigTopicRec, *bigTopicRecPtr;
  66.  
  67.     
  68. typedef struct
  69. {
  70.     short        nTopics;            // number of topic records
  71.     topicRec    theTopic;            // the first topic record
  72. }
  73. topicList, *topicListPtr, **topicListHdl;
  74.  
  75. #define        topicListResType    'TPIC'
  76. #define        hyperTextIndexType    'Hypx'
  77.  
  78. typedef struct
  79. {
  80.     short        pageID;                // hypertext page ID number
  81.     Str255        htMatchString;        // Link text match string
  82. }
  83. hypEntry;
  84.  
  85. typedef struct
  86. {
  87.     short        nEntries;            // number of entries on the page
  88.     hypEntry    hEntries[1];        // array of records
  89. }
  90. htIndex, *htIndexPtr, **htIndexHdl;
  91.  
  92.  
  93. SimHelpHdl    GetNewHelpDialog(short DialogID,short listItem,short textItem,short topicID);
  94. OSErr        BuildTopicList(SimHelpHdl sHelp,Rect *listBox);
  95. void        ModalHelpDialog(SimHelpHdl sHelp,short *theItem);
  96. void        DisposeHelpDialog(SimHelpHdl sHelp);
  97. DialogPtr    GetHelpDialogHdl(SimHelpHdl sHelp);
  98. pascal void    ListDrawProc(WindowPtr theWindow,short theItem);
  99. pascal void TopicListDef(short lMsg,Boolean lSelect,Rect *lRect,Cell lCell,
  100.                             short lDataOffset,short lDataLength,ListHandle theList);
  101.                             
  102. pascal Boolean    ModelessHelp(SimHelpHdl sHelp,short theItem,EventRecord *theEvent);
  103. void        SwitchPage(SimHelpHdl sHelp,Cell clickCell);
  104. void        InstallPage(SimHelpHdl sHelp,short pageID);
  105. Boolean        HandleHelpItems(SimHelpHdl sHelp,short *theItem);
  106. Handle        GetFunctionHandle(ProcPtr functionAddress); // from SneakyJump.c
  107.  
  108. /*
  109. pascal Boolean     ModelessText(DialogPtr theDialog,short theItem,EventRecord *theEvent);
  110. pascal Boolean TDFilter(DialogPtr theDialog,EventRecord *theEvent,short *itemHit);
  111. */
  112.  
  113. short        GetHypertextStyleRef(TEHandle teRec,short theStyle);
  114. short        ResolveHypertextLink(SimHelpHdl    sHelp,Point clickPt);
  115. short        MatchHyperLink(Str255 *testStr,htIndexHdl pageIndex);
  116. void        SetHyperlinkMatchStyle(SimHelpHdl    sHelp,short theStyle);
  117. void        SetHelpResFile(SimHelpHdl sHelp,short refNum);
  118. void        SwapHelpResFile(SimHelpHdl sHelp,Boolean hSwapContext);
  119.  
  120. #define        kSwapHelpIn        TRUE
  121. #define        kSwapHelpOut    FALSE